﻿using System;
using System.Data;
using System.Data.Common;
using Hxj.Data;
using Hxj.Data.Common;

namespace Utility.Model
{
    /// <summary>
    /// 字典实体
    /// </summary>
    [Serializable]
    public class Sys_Dic : Entity
    {
        /// <summary>
        /// 字典实体
        /// </summary>
        public Sys_Dic()
            : base("Sys_Dic")
        {
            this._DicID = Guid.NewGuid().ToString();
            this._CreateDate = Utility.ConvertHelper.GetNowDateTime();
            this._IsDelete = false;
            this._ParentDicID = string.Empty.ToString();
        }

        #region Model
        private string _DicID;
        private string _ParentDicID;
        private string _DicName;
        private string _DicDes;
        private int? _Sort;
        private bool? _IsDelete;
        private DateTime? _CreateDate;
        private string _CreateUser;
        /// <summary>
        /// 
        /// </summary>
        public string DicID
        {
            get { return _DicID; }
            set
            {
                this.OnPropertyValueChange(_.DicID, _DicID, value);
                this._DicID = value;
            }
        }
        /// <summary>
        /// 父级DicID
        /// </summary>
        public string ParentDicID
        {
            get { return _ParentDicID; }
            set
            {
                this.OnPropertyValueChange(_.ParentDicID, _ParentDicID, value);
                this._ParentDicID = value;
            }
        }
        /// <summary>
        /// 字典名称
        /// </summary>
        public string DicName
        {
            get { return _DicName; }
            set
            {
                this.OnPropertyValueChange(_.DicName, _DicName, value);
                this._DicName = value;
            }
        }
        /// <summary>
        /// 字典描述
        /// </summary>
        public string DicDes
        {
            get { return _DicDes; }
            set
            {
                this.OnPropertyValueChange(_.DicDes, _DicDes, value);
                this._DicDes = value;
            }
        }
        /// <summary>
        /// 排序
        /// </summary>
        public int? Sort
        {
            get { return _Sort; }
            set
            {
                this.OnPropertyValueChange(_.Sort, _Sort, value);
                this._Sort = value;
            }
        }
        /// <summary>
        /// 是否删除
        /// </summary>
        public bool? IsDelete
        {
            get { return _IsDelete; }
            set
            {
                this.OnPropertyValueChange(_.IsDelete, _IsDelete, value);
                this._IsDelete = value;
            }
        }
        /// <summary>
        /// 
        /// </summary>
        public DateTime? CreateDate
        {
            get { return _CreateDate; }
            set
            {
                this.OnPropertyValueChange(_.CreateDate, _CreateDate, value);
                this._CreateDate = value;
            }
        }
        /// <summary>
        /// 
        /// </summary>
        public string CreateUser
        {
            get { return _CreateUser; }
            set
            {
                this.OnPropertyValueChange(_.CreateUser, _CreateUser, value);
                this._CreateUser = value;
            }
        }
        #endregion

        #region Method
        /// <summary>
        /// 获取实体中的主键列
        /// </summary>
        public override Field[] GetPrimaryKeyFields()
        {
            return new Field[] {
				_.DicID,
				_.ParentDicID};
        }
        /// <summary>
        /// 获取列信息
        /// </summary>
        public override Field[] GetFields()
        {
            return new Field[] {
				_.DicID,
				_.ParentDicID,
				_.DicName,
				_.DicDes,
				_.Sort,
				_.IsDelete,
				_.CreateDate,
				_.CreateUser};
        }
        /// <summary>
        /// 获取值信息
        /// </summary>
        public override object[] GetValues()
        {
            return new object[] {
				this._DicID,
				this._ParentDicID,
				this._DicName,
				this._DicDes,
				this._Sort,
				this._IsDelete,
				this._CreateDate,
				this._CreateUser};
        }
        /// <summary>
        /// 给当前实体赋值
        /// </summary>
        public override void SetPropertyValues(IDataReader reader)
        {
            this._DicID = DataUtils.ConvertValue<string>(reader["DicID"]);
            this._ParentDicID = DataUtils.ConvertValue<string>(reader["ParentDicID"]);
            this._DicName = DataUtils.ConvertValue<string>(reader["DicName"]);
            this._DicDes = DataUtils.ConvertValue<string>(reader["DicDes"]);
            this._Sort = DataUtils.ConvertValue<int?>(reader["Sort"]);
            this._IsDelete = DataUtils.ConvertValue<bool?>(reader["IsDelete"]);
            this._CreateDate = DataUtils.ConvertValue<DateTime?>(reader["CreateDate"]);
            this._CreateUser = DataUtils.ConvertValue<string>(reader["CreateUser"]);
        }
        /// <summary>
        /// 给当前实体赋值
        /// </summary>
        public override void SetPropertyValues(DataRow row)
        {
            this._DicID = DataUtils.ConvertValue<string>(row["DicID"]);
            this._ParentDicID = DataUtils.ConvertValue<string>(row["ParentDicID"]);
            this._DicName = DataUtils.ConvertValue<string>(row["DicName"]);
            this._DicDes = DataUtils.ConvertValue<string>(row["DicDes"]);
            this._Sort = DataUtils.ConvertValue<int?>(row["Sort"]);
            this._IsDelete = DataUtils.ConvertValue<bool?>(row["IsDelete"]);
            this._CreateDate = DataUtils.ConvertValue<DateTime?>(row["CreateDate"]);
            this._CreateUser = DataUtils.ConvertValue<string>(row["CreateUser"]);
        }
        #endregion

        #region _Field
        /// <summary>
        /// 字段信息
        /// </summary>
        public class _
        {
            /// <summary>
            /// * 
            /// </summary>
            public readonly static Field All = new Field("*", "Sys_Dic");
            /// <summary>
            /// 
            /// </summary>
            public readonly static Field DicID = new Field("DicID", "Sys_Dic", "DicID");
            /// <summary>
            /// 父级DicID
            /// </summary>
            public readonly static Field ParentDicID = new Field("ParentDicID", "Sys_Dic", "父级DicID");
            /// <summary>
            /// 字典名称
            /// </summary>
            public readonly static Field DicName = new Field("DicName", "Sys_Dic", "字典名称");
            /// <summary>
            /// 字典描述
            /// </summary>
            public readonly static Field DicDes = new Field("DicDes", "Sys_Dic", "字典描述");
            /// <summary>
            /// 排序
            /// </summary>
            public readonly static Field Sort = new Field("Sort", "Sys_Dic", "排序");
            /// <summary>
            /// 是否删除
            /// </summary>
            public readonly static Field IsDelete = new Field("IsDelete", "Sys_Dic", "是否删除");
            /// <summary>
            /// 
            /// </summary>
            public readonly static Field CreateDate = new Field("CreateDate", "Sys_Dic", "CreateDate");
            /// <summary>
            /// 
            /// </summary>
            public readonly static Field CreateUser = new Field("CreateUser", "Sys_Dic", "CreateUser");
        }
        #endregion


    }
}



